//package com.web.client.configuration;
//
//import com.resource.base.BaseDto;
//import com.resource.base.BaseService;
//import com.resource.exception.AuthenticationCustomException;
//import com.utility.constant.HttpConstant;
//import feign.RequestInterceptor;
//import feign.RequestTemplate;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author: hw
// * @date: 2021/1/20 15:22
// */
//@Slf4j
//@Configuration
//public class FeignConfiguration  extends BaseService implements RequestInterceptor {
//
//
//    @Override
//    public void apply(RequestTemplate template) {
//        BaseDto userDto = getUserDto();
//        if (null == userDto && StringUtils.isEmpty(userDto.getToken())){
//            throw new AuthenticationCustomException("token已失效");
//        }
//        log.info("Feign 请求添加自定义请求头："+userDto.getToken());
//        template.header(HttpConstant.HEADERS_AUTHORIZATION, HttpConstant.HEADERS_BEARER+userDto.getToken());
//    }
//}
